package com.ehotting.edsta.diagnosisPredict.feign.factory;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.PageDto;
import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeCanvas;
import com.ehotting.edsta.diagnosisPredict.feign.FeCanvasFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 特征画布的降级处理
 * 
 * @author edsta
 */
@Slf4j
@Component
public class FeCanvasFallbackFactory implements FallbackFactory<FeCanvasFeignService> {

    @Override
    public FeCanvasFeignService create(Throwable throwable)
    {
        log.error("特征画布调用失败:{}", throwable.getMessage());
        return new FeCanvasFeignService() {
            @Override
            public Response<String> deleteByIds(String ids) {
                return null;
            }

            @Override
            public Response<FeCanvas> getById(Long id) {
                return null;
            }

            @Override
            public Response<List<FeCanvas>> list(String createTime, String creater, String explains, Long id, String iteminfoId, String itemname, String name) {
                return null;
            }

            @Override
            public Response<PageDto<FeCanvas>> pageList(String createTime, String creater, String explains, Long id, String iteminfoId, String itemname, String name, Long page, Long pageSize) {
                return null;
            }

            @Override
            public Response<FeCanvas> save(FeCanvas feCanvas) {
                return null;
            }

            @Override
            public Response<String> saveOrUpdate(FeCanvas t) {
                return null;
            }

            @Override
            public Response<String> saveorUpdateBatch(FeCanvas[] t) {
                return null;
            }

            @Override
            public Response<String> update(FeCanvas t) {
                return null;
            }

            @Override
            public Response<String> updateList(FeCanvas[] t) {
                return null;
            }
        };
    }
}
